﻿Ext.onReady()
{
	//基类Person，继承自Object
	Person = Ext.extend(Object,{
		constructor : function(first,second) {
			this.firstName = first;
			this.secondName = second;
		},
		
		getName : function() {
			return this.firstName + " " + this.secondName;
		}
	});
	
	//继承自Person得到Developer的子类
	Developer = Ext.extend(Person, {
		getName : function() {
			if(this.isCoding) {
				return "Go Away!";
			} else {
				return Developer.superclass.getName.call(this);
			}
		}
	});
	
	//测试是否成功继承
	var p = new Person("John",'Smith');
	alert("Hi " + p.getName() + "欢迎");
}